ASoC: SOF: ipc4-topology: Allow the use of multiple formats for src output#5694
Merged
ujfalusi merged 1 commit intothesofproject:topic/sof-devfrom Mar 27, 2026
Merged
Conversation
ujfalusi
commented
Mar 13, 2026
| sof_ipc4_update_resource_usage(sdev, swidget, &src->data.base_config); | ||
|
|
||
| out_audio_fmt = &available_fmt->output_pin_fmts[output_fmt_index].audio_fmt; | ||
| src->data.sink_rate = out_audio_fmt->sampling_frequency; |
Collaborator
Author
There was a problem hiding this comment.
this is a bogus change.
9f533aa to
a8e7689
Compare
…utput The SRC module can only change the rate, it keeps the format and channels intact, but this does not mean the the num_output_formats must be 0: The SRC module can support different formats/channels, we just need to check if the output format lists the correct combination of out rate and the input format/channels. Change the logic to prioritize the sink_rate of the module as target rate, then the rate of the FE in case of capture or in case of playback check the single rate specified in the output formats. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
singalsu
approved these changes
Mar 13, 2026
Collaborator
singalsu
left a comment
There was a problem hiding this comment.
This worked, I just successfully tested with compress playback random format sine wav files and all rates/channels/formats combinations worked. Thanks Peter!
bardliao
approved these changes
Mar 18, 2026
kv2019i
approved these changes
Mar 26, 2026
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
Looks good (once I understood what "sink_rate" was)
| out_ref_rate = params_rate(fe_params); | ||
| if (src->data.sink_rate) { | ||
| /* Use the sink rate as reference */ | ||
| out_ref_rate = src->data.sink_rate; |
Collaborator
There was a problem hiding this comment.
Btw, this is a bit confusing to understand as the variable is "sink_rate" but the topology name is "rate_out". But not related to this PR, but right, so priority is given to the rate defined in topology (rate_out token).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…utput
The SRC module can only change the rate, it keeps the format and channels intact, but this does not mean the the num_output_formats must be 0: The SRC module can support different formats/channels, we just need to check if the output format lists the correct combination of out rate and the input format/channels.
Change the logic to prioritize the sink_rate of the module as target rate, then the rate of the FE in case of capture or in case of playback check the single rate specified in the output formats.